using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestinationShower : MonoBehaviour
{
    public int life;
    private void OnEnable()
    {
        MouseManager.Instance.OnMouseClicked += Show;
        life = 1;
    }

    private void OnDisable()
    {
        MouseManager.Instance.OnMouseClicked -= Show;
    }

    private void Show(Vector3 tar)
    {
        this.transform.position = tar;
        life--;
        if (life == 0)
        {
            Destroy(gameObject);
        }
    }


}
